import request from '@/utils/request';

// 店铺权益定价、数量
export function postEquity(data) {
  return request({
    method: 'POST',
    url: '/equity',
    data,
  });
}

// 店铺行业的数据
export function getVocation() {
  return request({
    method: 'GET',
    url: '/vocation',
  });
}

// 删除店铺行业数据
export function delVocation(id) {
  return request({
    method: 'DELETE',
    url: `/vocation/${id}`,
  });
}

// 修改店铺行业数据
export function editVocation(data, id) {
  return request({
    method: 'PATCH',
    url: `/vocation/${id}`,
    data,
  });
}

// 上面的数据分页接口
export function getVocationPage(params) {
  return request({
    method: 'GET',
    url: '/vocation',
    params,
  });
}

// 商品类别的数据
export function getCategory() {
  return request({
    method: 'GET',
    url: '/category',
  });
}

// 商品类别的分页数据
export function getCategoryPage(params) {
  return request({
    method: 'GET',
    url: '/category',
    params,
  });
}

// 删除类别数据
export function delCategory(id) {
  return request({
    method: 'DELETE',
    url: `/category/${id}`,
  });
}

// 修改类别数据
export function editCategory(data, id) {
  return request({
    method: 'PATCH',
    url: `/category/${id}`,
    data,
  });
}
